package pokerantani.v2.model;

import java.util.ArrayList;
import java.util.List;

public class Player {
	public final int seatNumber;
	public final String name;
	public final float chips;
	public final List<Card> cards = new ArrayList<Card>(2);
	
	public Player(String name) {
		this(0, name, 0);
	}
	
	public Player(int seatNumber, String name) {
		this(seatNumber, name, 0);
	}
	
	public Player(int seatNumber, String name, float chips) {
		this.seatNumber = seatNumber;
		this.name = name;
		this.chips = chips;
	}
	
	public String toString() {
		return name;
	}
	
	@Override
	public boolean equals(Object o) {
		if(o == null) return false;
		if(o instanceof String) {
			String s = (String)o;
			return s.equals(name);
		} else if(o instanceof Player) {
			Player p = (Player)o;
			return p.name.equals(name);
		} else {
			return false;
		}
	}
}
